package com.wanho.java156.controller;

import org.apache.shiro.authz.UnauthorizedException;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.servlet.ModelAndView;

@ControllerAdvice
public class ExceptionController {
    @ExceptionHandler(UnauthorizedException.class)
    public ModelAndView exception(Throwable t) throws  Throwable{
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.setViewName("redirect:/failer.jsp");
        return modelAndView ;
    }
}
